package gui;

import java.io.File;

/**
 * @author Ramy Refky 
 * */
public class PNGFileFilter  extends javax.swing.filechooser.FileFilter {
	
	/**
	 * Sets the filter to view directories and .png files only.
	 * @return boolean
	 * */
	@Override
	public boolean accept(File file) {
		if (file.isDirectory()) { 
			return true; 
		}	
        String filename = file.getName();
        return filename.endsWith(".png");
    }
	/**
	 * Gets the extension of the file.
	 * @return String
	 * */
    public String getDescription() {
        return "*.png";
    }
}

